<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div fxLayout="column">
    <div class="asset-title">{{ rootAsset.assetName }}</div>
    <div class="asset-description">{{ rootAsset.assetDescription }}</div>

    <div fxLayout="column" class="asset-metadata mt-20">
        <div fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start center">
            <mat-icon color="primary">precision_manufacturing</mat-icon>
            <div class="asset-description">{{ assetType }}</div>
        </div>
        <div fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start center">
            <mat-icon color="primary">location_on</mat-icon>
            <div class="asset-description">{{ assetSite?.label || '-' }}</div>
        </div>
        <div fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start center">
            <mat-icon color="primary">factory</mat-icon>
            <div class="asset-description">
                {{ rootAsset.assetSite?.area || '-' }}
            </div>
        </div>
    </div>

    <div
        fxLayout="column"
        *ngIf="selectedAsset.assetId !== rootAsset.assetId"
        class="selected-asset-metadata mt-20"
    >
        <div class="selected-asset-title">{{ selectedAsset.assetName }}</div>
        <div class="selected-asset-description">
            {{ selectedAsset.assetDescription }}
        </div>
        <div fxLayout="column" class="asset-metadata mt-20">
            <div fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start center">
                <mat-icon color="primary">precision_manufacturing</mat-icon>
                <div class="asset-description">{{ selectedAssetType }}</div>
            </div>
            <div
                fxLayout="row"
                fxLayoutGap="10px"
                fxLayoutAlign="start center"
                *ngIf="selectedAsset.labelIds?.length > 0"
            >
                <mat-icon color="primary">sell</mat-icon>
                <sp-view-asset-labels
                    [asset]="selectedAsset"
                    size="small"
                ></sp-view-asset-labels>
            </div>
        </div>
    </div>
</div>
